package com.cn.study.fourth.stage.zuoye1;

import java.io.FileOutputStream;
import java.io.ObjectOutputStream;
import java.util.List;

public class Writelist {
    public static void writelist(List list){
        ObjectOutputStream out=null;
        try {
            out=new ObjectOutputStream(new FileOutputStream("/Users/libingbing/lagou/student.txt"));
            out.writeObject(list);
        }catch (Exception e){
            e.printStackTrace();
        }finally {
            if (out!=null){
                try {
                    out.close();

                }catch (Exception e){
                    e.printStackTrace();
                }
            }
        }

    }
}
